Unlocks the door whose own door_id is door, letting it send (act as an Enter door) again. door may be the door’s own name (given it in the Room Editor) - resolved to its door_id at compile time, for free - or a door_id int, literal or computed.
door_unlock(door)| Name | Type |
|---|---|
door | door |
Nothing.
Unlocks the door whose own door_id is door, letting it send (act as an Enter door) again. The setter twin of door_lock - see that page for how a door is found by its door_id, for the Enter/Exit terms this page assumes, and for how door also accepts a door's own NAME (resolved to its door_id at compile time) alongside a plain door_id int.
Unlocking an already-unlocked door is harmless. Unlocking a door whose door_mode is DOOR_EXIT_ONLY is also harmless, just unobservable on its own - an Exit-only door never sends regardless of locked, so door_unlock still stores the value (read back correctly by door_is_locked) even though nothing about the door's own runtime behavior changes until its mode changes too.
if (door_is_locked(3)) {
door_unlock(3);
}A key-shaped pickup's own effect: unlocks the door whose door_id is 3, if it is not already unlocked. The same door_id a door's own locked/door_mode instance variables carry can also be read straight off a held reference instead - var d = instance_nearest(x, y, obj_door_obj_player); if (d != nothing) { d.locked = false; } reaches the same door with no function call at all, when a reference to it is already in scope (see door_lock's own description for when each route earns its place).
Same current-room-only limit as door_lock: a door_id belonging to a room that is not the one currently loaded is not a live instance of anything right now, so it is never found, and the call does nothing.
A no-op if door names no LIVE door instance right now - see this group’s own header for the current-room-only limit. Unlocking an already-unlocked door, or one whose door_mode is DOOR_EXIT_ONLY (never sends regardless of locked), is harmless - the value is still stored and still read back by door_is_locked. A door NAME that no longer exists is a compile error naming it, not a silent no-op.